const axios = require("axios");
exports.login_required = (req, res, next)=>{
    if(req.cookies.token && req.cookies.uid){
    	axios.defaults.headers["token"] = req.cookies.token || "";
    	axios.defaults.headers["uid"] = req.cookies.uid || "";
        next();
    }else{
    	let next = req.originalUrl;
        res.redirect(`/login?next=${next}`);
    };
};
